#ifndef __QUEUE
#define _QUEUE
#include<mutex>
#include<queue>
#include<condition_variable>
#include<functional>
class ThreadPool;
using element =std::function<void()>;
class Taskqueue{
public:
    friend class ThreadPool;
    Taskqueue(size_t capa);
    void push(element &&rhs);
    void wakeup();
    element pop();
    //实现也就是逻辑
    //构造
    //插入
    //删除
    //判空
    //判满
private:
    bool full();
    bool empty();
private:
    //成员
    //_capacity
    //_queue
    //condtion_full
    //condition_empty
    //mutex
    size_t _capacity;
    std::queue<element> _queue;
    std::mutex _mtl;
    std::condition_variable _not_full;
    std::condition_variable _not_empty;
    //用于判断线程是否要退出
    bool _flag;
};
#endif
